﻿<%@ Page Language="C#" AutoEventWireup="true" Title="Cobranza" MasterPageFile="~/MasterPage.master" CodeFile="Cobranza.aspx.cs" Inherits="Clientes_Cobranza"%>

<%@ Register Src="../UserControls/Fecha.ascx" TagName="Fecha" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="content" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> &nbsp;
<asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager>
    &nbsp;
    <table width="100%">
        <tr>
            <td class="tdVentas" colspan="4" style="width: 100%">
                Cobranza de Clientes</td>
        </tr>
        <tr>
            <td class="tdForm" colspan="4" style="width: 100%; text-align: center">
                <asp:Label ID="lblAccion" runat="server" CssClass="lblAccion" Text="lblAccion"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="tdForm" style="width: 15%; text-align: right">
                Cliente:</td>
            <td class="tdForm" colspan="1" style="width: 20%; height: 14px; text-align: left">
                <asp:TextBox ID="txtIdCliente" runat="server" AutoPostBack="True" OnTextChanged="txtIdCliente_TextChanged"
                    Width="70px"></asp:TextBox>&nbsp;
                <asp:Button ID="btnBuscarCliente" runat="server" OnClick="btnBuscarCliente_Click"
                    Text="..." /></td>
            <td class="tdForm" colspan="2" style="width: 65%; text-align: left">
                <asp:TextBox ID="txtCliente" runat="server" Width="90%"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="tdForm" colspan="2" style="text-align: right">
                Saldo Cta. Cte. :</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <asp:TextBox ID="txtSaldo" runat="server" CssClass="numero" ReadOnly="True" Width="100px"></asp:TextBox></td>
        </tr>
        <tr id="trFac1" runat="server">
            <td class="tdForm" colspan="2" style="text-align: right">
                Imputa Venta:</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <asp:CheckBox ID="chkImputa" runat="server" AutoPostBack="True" Checked="True" OnCheckedChanged="chkImputa_CheckedChanged" /></td>
        </tr>
        <tr runat="server">
            <td class="tdForm" colspan="2" style="text-align: right">
                Fecha Cobranza:</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <uc1:Fecha ID="Fecha1" runat="server" />
            </td>
        </tr>
        <tr id="trFac2" runat="server">
            <td class="tdForm" colspan="2" style="text-align: right">
                Factura:</td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <asp:TextBox ID="txtFactura" runat="server" AutoPostBack="True" OnTextChanged="txtIdCliente_TextChanged"
                    ReadOnly="True" Width="100px"></asp:TextBox></td>
        </tr>
        <tr id="trFac3" runat="server">
            <td class="tdForm" colspan="2" style="height: 17px; text-align: right">
                Saldo Factura:</td>
            <td class="tdForm" colspan="2" style="height: 17px; text-align: left">
                <asp:TextBox ID="txtSaldoFac" runat="server" AutoPostBack="True" CssClass="numero"
                    OnTextChanged="txtIdCliente_TextChanged" ReadOnly="True" Width="70px"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="left" class="tdForm" colspan="2" style="text-align: right">
                <asp:Label ID="lblMonto" runat="server" Text="Monto $:"></asp:Label></td>
            <td class="tdForm" colspan="2" style="text-align: left">
                <asp:TextBox ID="txtMonto" runat="server" CssClass="numero" MaxLength="10" Width="100px">0</asp:TextBox>
                <asp:RangeValidator ID="rvMonto" runat="server" ControlToValidate="txtMonto" ErrorMessage="(*)"
                    MaximumValue="9999999.99" MinimumValue="0.00" Type="Double"></asp:RangeValidator></td>
        </tr>
        <tr>
            <td class="tdForm" style="width: 15%; text-align: right">
                <asp:Label ID="lblObservaciones" runat="server" Text="Observaciones:"></asp:Label>
            </td>
            <td align="left" class="tdForm" colspan="3" style="width: 85%; text-align: left">
                <asp:TextBox ID="txtObservaciones" runat="server" Width="95%"></asp:TextBox>
            </td>
        </tr>
        <tr id="trCheques1" runat="server">
            <td class="tdTit" colspan="4" style="width: 100%; text-align: center">
                CHEQUES</td>
        </tr>
        <tr id="trCheques2" runat="server">
            <td class="tdForm" colspan="4" style="width: 100%; text-align: center">
                <table style="width: 100%; text-align: center">
                    <tr>
                        <td class="tdForm" style="width: 10%; text-align: right">
                            Cod.Banco:
                            </td>
                        <td class="tdForm" style="width: 10%; text-align: left">
                            <asp:TextBox ID="txtCodBanco" runat="server" Columns="3"></asp:TextBox>
                            </td>
                        <td class="tdForm" style="width: 10%; text-align: right">
                            Banco:
                            </td>
                        <td class="tdForm" style="width: 30%; text-align: left">
                            <asp:TextBox ID="txtBanco" runat="server" Width="98%"></asp:TextBox></td>
                        <td class="tdForm" style="width: 10%; text-align: right">
                            Numero:
                            </td>
                        <td class="tdForm" style="width: 40%; text-align: left">
                            <asp:TextBox ID="txtNumero" runat="server" Width="98%"></asp:TextBox></td>
                    </tr>
                    <tr>
                         <td class="tdForm" style="text-align: right">
                            Monto:
                            </td>
                         <td class="tdForm" style="text-align: left">
                             <asp:TextBox ID="txtMontoCheque" runat="server"
                                 Width="70px" ReadOnly="True">0</asp:TextBox></td>
                         <td class="tdForm" style="text-align: right">
                            Fecha:
                            </td>
                        <td class="tdForm" style="text-align: left">
                            <uc1:Fecha ID="FechaCh" runat="server" />
                            </td>
                        <td class="tdLiteral" style="text-align: center" colspan="2">
                            <asp:TextBox ID="txtItem" runat="server" Columns="3" ReadOnly="True"></asp:TextBox>
                            &nbsp;
                            <asp:DropDownList ID="cboEstado" runat="server" Width="100px">
                            </asp:DropDownList>
                            &nbsp; &nbsp; &nbsp;<asp:Button ID="btnAgregaCheque" runat="server" OnClick="btnAgregarCheque_Click" Text="Cambiar" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="trCheques3" runat="server">
            <td class="tdForm" colspan="4" style="width: 100%; text-align: center">
                <asp:GridView ID="gvCheques" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
                                CellPadding="3" GridLines="Vertical" Width="100%"
                                DataKeyNames="Item"
                                OnPageIndexChanging="gvCheques_PageIndexChanging" 
                                OnSelectedIndexChanged="gvCheques_SelectedIndexChanged" 
                                OnRowDataBound="gvCheques_RowDataBound" >
                                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Cheque">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Item" runat="server" Text='<%# Bind("Item") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cod.">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="CodBanco" runat="server" Text='<%# Bind("CodBanco") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Banco">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Banco" runat="server" Text='<%# Bind("Banco") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                     <asp:TemplateField HeaderText="N&#250;mero">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Numero" runat="server" Text='<%# Bind("Numero") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Fecha">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="FechaCh" runat="server" Text='<%# Bind("FechaCh", "{0:dd/MM/yyyy}") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Monto">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Monto" runat="server" Text='<%# Bind("Monto") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                     <asp:TemplateField HeaderText="Estado">
                                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:Label ID="Estado" runat="server" Text='<%# Bind("Estado") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ShowHeader="False">
                        <HeaderStyle ForeColor="White"></HeaderStyle>
                        <ItemTemplate>
                            <asp:LinkButton runat="server" Text="Seleccionar" CommandName="Select" CausesValidation="False" id="LinkButton2"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                                </Columns>
                                <RowStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center" />
                                <EditRowStyle Wrap="True" />
                                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="#325FB9" Font-Bold="True" Font-Names="Arial Rounded MT Bold"
                                    ForeColor="White" />
                                <AlternatingRowStyle BackColor="Gainsboro" />
                            </asp:GridView>
            </td>
        </tr>
    </table>
    <table class="tdForm" style="width: 100%">
        <tr>
            <td style="width: 100%" class="tdBotones"><asp:Button ID="btnOtro" runat="server" OnClick="btnOtro_Click" Text="Cargar Otro" />
                &nbsp;
                <asp:Button ID="btnGuardar" runat="server" OnClick="btnGuardar_Click" Text="Guardar" />
                &nbsp; &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" Text="Cancelar" />
                &nbsp;&nbsp;
            </td>
        </tr>
    </table>
   <asp:Panel ID="pnlMensaje" runat="server" CssClass="tdBotones" Style="display: none"
        Width="233px">
        <div style="background-image: none; background-color: transparent; text-align: center">
            <asp:Label ID="lblMensaje" runat="server" Text="Códido de Barras Inexistente"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnMensaje" runat="server" Text="OK" Width="64px" />
        </div>
    </asp:Panel>
    <table id="tblMensaje" runat="server" border="0" style="width: 0px; height: 0px">
        <tr>
            <td style="width: 100px; height: 18px">
                <asp:Button ID="btnMalMensaje" runat="server" Height="0px" Text="Button" Width="0px" />
            </td>
        </tr>
    </table>
    <cc1:ModalPopupExtender ID="mpeMensaje" runat="server" BackgroundCssClass="modalBackground"
        DropShadow="true" OkControlID="btnMensaje" PopupControlID="pnlMensaje" TargetControlID="btnMalMensaje">
    </cc1:ModalPopupExtender>
    
</asp:Content>
